﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace SZ.Mech
{
    /// <summary>
    /// 继晷buff
    /// </summary>
    public class HediffCompProperties_Gnomon : HediffCompProperties
    {
        public HediffCompProperties_Gnomon()
        {
            this.compClass = typeof(HediffComp_Gnomon);
        }
    }

    public class HediffComp_Gnomon : HediffComp
    {

        public Pawn owner;
        public HediffCompProperties_Gnomon Props
        {
            get
            {
                return (HediffCompProperties_Gnomon)props;
            }
        }
        public override void CompPostTick(ref float severityAdjustment)
        {
            //base.CompPostTick(ref severityAdjustment);
            if (owner.Map != this.Pawn.Map)
            {
                this.Pawn.health.RemoveHediff(parent);
            }
        }

        public override void CompExposeData()
        {
            base.CompExposeData();
            Scribe_References.Look(ref owner, "owner");
        }
    }
}
